/*******************************************************************************
 *                                    ZLG
 *                         ----------------------------
 *                         innovating embedded platform
 *
 * Copyright (c) 2001-present Guangzhou ZHIYUAN Electronics Co., Ltd.
 * All rights reserved.
 *
 * Contact information:
 * web site:    https://www.zlg.cn
 *******************************************************************************/
#ifndef __HPM6E00_REGS_GPIO_H
#define __HPM6E00_REGS_GPIO_H

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus*/

#include "core/include/hpm6e00_regs_base.h"
#include <stdint.h>

typedef struct {
    struct {
        volatile uint32_t      VALUE;                   /* 0x0: GPIO input value */
        volatile uint8_t       RESERVED0[12];           /* 0x4 - 0xF: Reserved */
    } DI[16];
    struct {
        volatile uint32_t      VALUE;                   /* 0x100: GPIO output value */
        volatile uint32_t      SET;                     /* 0x104: GPIO output set */
        volatile uint32_t      CLEAR;                   /* 0x108: GPIO output clear */
        volatile uint32_t      TOGGLE;                  /* 0x10C: GPIO output toggle */
    } DO[16];
    struct {
        volatile uint32_t      VALUE;                   /* 0x200: GPIO direction value */
        volatile uint32_t      SET;                     /* 0x204: GPIO direction set */
        volatile uint32_t      CLEAR;                   /* 0x208: GPIO direction clear */
        volatile uint32_t      TOGGLE;                  /* 0x20C: GPIO direction toggle */
    } OE[16];
    struct {
        volatile uint32_t      VALUE;                   /* 0x300: GPIO interrupt flag value */
        volatile const uint8_t RESERVED0[12];           /* 0x304 - 0x30F: Reserved */
    } IF[16];
    struct {
        volatile uint32_t      VALUE;                   /* 0x400: GPIO interrupt enable value */
        volatile uint32_t      SET;                     /* 0x404: GPIO interrupt enable set */
        volatile uint32_t      CLEAR;                   /* 0x408: GPIO interrupt enable clear */
        volatile uint32_t      TOGGLE;                  /* 0x40C: GPIO interrupt enable toggle */
    } IE[16];
    struct {
        volatile uint32_t      VALUE;                   /* 0x500: GPIO interrupt polarity value */
        volatile uint32_t      SET;                     /* 0x504: GPIO interrupt polarity set */
        volatile uint32_t      CLEAR;                   /* 0x508: GPIO interrupt polarity clear */
        volatile uint32_t      TOGGLE;                  /* 0x50C: GPIO interrupt polarity toggle */
    } PL[16];
    struct {
        volatile uint32_t      VALUE;                   /* 0x600: GPIO interrupt type value */
        volatile uint32_t      SET;                     /* 0x604: GPIO interrupt type set */
        volatile uint32_t      CLEAR;                   /* 0x608: GPIO interrupt type clear */
        volatile uint32_t      TOGGLE;                  /* 0x60C: GPIO interrupt type toggle */
    } TP[16];
    struct {
        volatile uint32_t      VALUE;                   /* 0x700: GPIO interrupt asynchronous value */
        volatile uint32_t      SET;                     /* 0x704: GPIO interrupt asynchronous set */
        volatile uint32_t      CLEAR;                   /* 0x708: GPIO interrupt asynchronous clear */
        volatile uint32_t      TOGGLE;                  /* 0x70C: GPIO interrupt asynchronous toggle */
    } AS[16];
    struct {
        volatile uint32_t      VALUE;                   /* 0x800: GPIO dual edge interrupt enable value */
        volatile uint32_t      SET;                     /* 0x804: GPIO dual edge interrupt enable set */
        volatile uint32_t      CLEAR;                   /* 0x808: GPIO dual edge interrupt enable clear */
        volatile uint32_t      TOGGLE;                  /* 0x80C: GPIO dual edge interrupt enable toggle */
    } PD[16];
} hpm_gpio_regs_t;

#define HPM_GPIO0 ((hpm_gpio_regs_t *)HPM_GPIO0_BASE)
#define HPM_GPIO1 ((hpm_gpio_regs_t *)HPM_GPIO1_BASE)
#define HPM_PGPIO ((hpm_gpio_regs_t *)HPM_PGPIO_BASE)
#define HPM_BGPIO ((hpm_gpio_regs_t *)HPM_BGPIO_BASE)

#ifdef __cplusplus
}
#endif  /* __cplusplus  */
#endif






